<?php
/**
 * Created by PhpStorm.
 * User: qzy008
 * Date: 2018/9/4
 * Time: 17:45
 */

namespace app\api\validate\article;

use app\common\validate\BaseValidate;

class ArticleCreateOrEdit extends BaseValidate
{
    protected $rule = [
        'id' => 'require|isPositiveInteger',
        'title' => 'require|min:1|max:50',
        'content' => 'require|isNotEmpty'
    ];
    protected $message = [
        'title' => '文章标题必须在1-50位之间',
        'content' => '文章内容不能为空'
    ];
    protected $scene = [
        'create' => [
            'title' => 'require|min:1|max:50',
            'content' => 'require|isNotEmpty'
        ]
    ];
}